import { observer } from "mobx-react";
import loadjs from 'loadjs';
import { toJS } from 'mobx'

@observer
export default class TaskViewCustomPage extends React.Component {

    render() {
        const { store, loadCurPage } = this.props;
        const { pageType } = store;
        return (
            <div className="edc-task-view-cuspage">
                {pageType === 'CUSTOM' ?
                    <iframe height="100%" width="100%" frameBorder="0" className="cuspage-frame" ref={ref => this.iframe = store.iframe = ref}></iframe>
                    : pageType === 'LOAD' ?

                        <div style={{ height: "100%", width: "100%" }}>
                            {loadCurPage}
                        </div>

                        : null}
            </div>
        )
    }
}